<?php
$db = new PDO('mysql:host=localhost; dbname=db3', 'root', '12qwas');
$ps=$db->query('select * from students');
$rs=$ps->fetchAll();
//print_r($rs);
echo "{$rs[0]['xh']}\t{$rs[1]['name']}\t{$rs[2]['age']}";